package webmarket.controller.transferobjects;

import java.sql.Timestamp;
import java.util.LinkedList;
import java.util.List;

import webmarket.model.User;

public class UserTO {

	public static List<UserTO> convert(List<User> from){
		List<UserTO> result=new LinkedList<UserTO>();
		for (User user: from){
			result.add(new UserTO(user));
		}
		return result;
	}
	
	private String username;
	private String firstname;
	private String lastname;
	private Timestamp registered;
	private Timestamp lastlogin;
	private String city;
	private boolean active;
	
	public UserTO(User from){
		this.setUsername(from.getUsername());
		this.setFirstname(from.getFirstname());
		this.setLastlogin(from.getLastlogin());
		this.setLastname(from.getLastname());
		this.setRegistered(from.getRegistered());
		this.setCity(from.getCity());
		this.setActive(from.getActive());
	}

	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * @param username the username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * @return the firstname
	 */
	public String getFirstname() {
		return firstname;
	}

	/**
	 * @param firstname the firstname to set
	 */
	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	/**
	 * @return the lastname
	 */
	public String getLastname() {
		return lastname;
	}

	/**
	 * @param lastname the lastname to set
	 */
	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	/**
	 * @return the registered
	 */
	public Timestamp getRegistered() {
		return registered;
	}

	/**
	 * @param registered the registered to set
	 */
	public void setRegistered(Timestamp registered) {
		this.registered = registered;
	}

	/**
	 * @return the lastlogin
	 */
	public Timestamp getLastlogin() {
		return lastlogin;
	}

	/**
	 * @param lastlogin the lastlogin to set
	 */
	public void setLastlogin(Timestamp lastlogin) {
		this.lastlogin = lastlogin;
	}

	/**
	 * @return the city
	 */
	public String getCity() {
		return city;
	}

	/**
	 * @param city the city to set
	 */
	public void setCity(String city) {
		this.city = city;
	}

	/**
	 * @return the active
	 */
	public boolean isActive() {
		return active;
	}

	/**
	 * @param active the active to set
	 */
	public void setActive(boolean active) {
		this.active = active;
	}
}
